
export default {
  data() {
    return {

    }
  },
  computed: {
    catacolumn() {
      return [
        {
          width: '55',
          type: 'selection',
          align: 'center'
        },
        {
          prop: 'value',
          label: '类别值'
        },
        {
          prop: 'name',
          label: '类别名称'
        },
        {
          prop: 'sequence',
          label: '序号'
        },
        {
          prop: 'memo',
          label: '是否作废',
          render: (h, params) => {
            const label = params.row.zfFlag === '0' ? '否' : '是'
            return h('div', label)
          }
        },
        {
          prop: 'memo',
          label: '备注'
        },
        {
          label: '操作',
          width: 200,
          render: (h, params) => {
            if (params.row.zfFlag !== '1') {
              return h('div',
                [
                  h(
                    'el-button',
                    {
                      props: {
                        type: 'text',
                        size: 'small',
                        icon: 'el-icon-edit',
                        loading: false,
                        'v-oauth': true,
                        'data-oauthUuid': '1604910616413'
                      },
                      style: {
                        marginRight: '5px'
                      },
                      on: {
                        click: () => {
                          this.handleEdit(params)
                        }
                      }
                    },
                    '编辑'
                  ),
                  h('el-divider', {
                    props: {
                      direction: 'vertical'
                    }
                  }),
                  h(
                    'el-button',
                    {
                      props: {
                        type: 'text',
                        size: 'small',
                        icon: 'el-icon-delete',
                        loading: false,
                        'v-oauth': true,
                        'data-oauthUuid': '1604910631959'
                      },
                      on: {
                        click: () => {
                          this.handleDelete(params)
                        }
                      }
                    },
                    '删除'
                  ),
                  h('el-divider', {
                    props: {
                      direction: 'vertical'
                    }
                  }),
                  h(
                    'el-button',
                    {
                      props: {
                        type: 'text',
                        size: 'small',
                        icon: 'el-icon-delete',
                        loading: false,
                        'v-oauth': true,
                        'data-oauthUuid': '1604910631929'
                      },
                      on: {
                        click: () => {
                          this.handleCancel(params)
                        }
                      }
                    },
                    '作废'
                  )
                ]
              )
            } else {
              return h('div',
                [
                  h(
                    'el-button',
                    {
                      props: {
                        type: 'text',
                        size: 'small',
                        icon: 'el-icon-delete',
                        loading: false,
                        'v-oauth': true,
                        'data-oauthUuid': '1604910631959'
                      },
                      on: {
                        click: () => {
                          this.handleDelete(params)
                        }
                      }
                    },
                    '删除'
                  )
                ]
              )
            }
          }
        }
      ]
    },
    codeColumn() {
      return [
        {
          width: '55',
          type: 'selection',
          align: 'center'
        },
        {
          prop: 'value',
          label: '编码值'
        },
        {
          prop: 'name',
          label: '编码名称'
        },
        {
          prop: 'sequence',
          label: '序号'
        },
        {
          prop: 'memo',
          label: '是否作废',
          render: (h, params) => {
            const label = params.row.zfFlag === '0' ? '否' : '是'
            return h('div', label)
          }
        },
        {
          prop: 'memo',
          label: '备注'
        },
        {
          label: '操作',
          width: 200,
          render: (h, params) => {
            if (params.row.zfFlag !== '1') {
              return h('div', [
                h(
                  'el-button',
                  {
                    props: {
                      type: 'text',
                      size: 'small',
                      icon: 'el-icon-edit',
                      loading: false,
                      'data-oauthUuid': '1604910658304'
                    },
                    style: {
                      marginRight: '5px'
                    },
                    on: {
                      click: () => {
                        this.handleEdit(params)
                      }
                    }
                  },
                  '编辑'
                ),
                h('el-divider', {
                  props: {
                    direction: 'vertical'
                  }
                }),
                h(
                  'el-button',
                  {
                    props: {
                      type: 'text',
                      size: 'small',
                      icon: 'el-icon-delete',
                      loading: false,
                      'data-oauthUuid': '1604910671397'
                    },
                    on: {
                      click: () => {
                        this.handleDelete(params)
                      }
                    }
                  },
                  '删除'
                ),
                h('el-divider', {
                  props: {
                    direction: 'vertical'
                  }
                }),
                h(
                  'el-button',
                  {
                    props: {
                      type: 'text',
                      size: 'small',
                      icon: 'el-icon-delete',
                      loading: false,
                      'v-oauth': true,
                      'data-oauthUuid': '1604910631929'
                    },
                    on: {
                      click: () => {
                        this.handleCancel(params)
                      }
                    }
                  },
                  '作废'
                )
              ])
            } else {
              return h('div', [
                h(
                  'el-button',
                  {
                    props: {
                      type: 'text',
                      size: 'small',
                      icon: 'el-icon-delete',
                      loading: false,
                      'data-oauthUuid': '1604910671397'
                    },
                    on: {
                      click: () => {
                        this.handleDelete(params)
                      }
                    }
                  },
                  '删除'
                )
              ])
            }
          }
        }
      ]
    }
  },
  methods: {

  }
}
